#region Header
//=============================================================================
//                          GShield (Game Shield)
//=============================================================================
//
// Original Programmer: Shawn Jackson
// Company: WaveTech Digital Technologies, Inc. (http://www.wtdt.com)
// Copyright: (c) 2006 WaveTech Digital Technologies, Inc. All Rights Reserved.
// Assembly: Library
// Code File Name: Log.cs
// Code File Date: 12/8/2006
//
// Code File Info: Log Object Definiation
//=============================================================================
/*
 * UPDATES
 * -------
 *			ShawnJ 5/4/2007 (0.9.0.x): Refactoring for OSS.
 *			ShawnJ 8/7/2007 (0.9.5.x): Code Commenting.
 */
#endregion Header

#region License
/*
  GShield - Game Shield
  Copyright (C) 2006-2007 WaveTech Digital Technologies, Inc.
                                http://www.wtdt.com

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
#endregion License

#region Includes
using System;
using System.Text;
using WaveTech.GShield.Library.Enumerations;
#endregion Includes

namespace WaveTech.GShield.Library.Objects
{
    /*
  /// <summary>
  /// Class defining a Log object
  /// </summary>
	[Serializable]
  public class Log
	{
		#region Private Members
		private int? m_id;
		private LogType? m_logType;
		private int? m_parentId;
		private string m_userName;
		private int? m_time;
		private TimeType? m_timeType;
		private string m_message;
		private DateTime? m_timestamp;
		private string m_hash;
		#endregion Private Members

		#region Consturctors
		public Log(){}
    
    public Log(LogType type, int? parentId, string userName, int? time, TimeType? timeType, string message)
    {
      m_logType = type;
      m_parentId = parentId;
      m_userName = userName;
      m_time = time;
      m_timeType = timeType;
      m_message = message;
      m_timestamp = DateTime.Now;
    }
    #endregion Consturctors

    #region Public Properties
		/// <summary>
		/// Primary Identifier for the Log Object
		/// </summary>
    public int? Id
    {
      get { return m_id; }
      set { m_id = value; }
    }

		/// <summary>
		/// Type of system this log entry is for
		/// </summary>
    public LogType? LogType
    {
      get { return m_logType; }
      set { m_logType = value; }
    }

		/// <summary>
		/// Parent Object Id, i.e. Game or Policy for this log entry
		/// </summary>
    public int? ParentId
    {
      get { return m_parentId; }
      set { m_parentId = value; }
    }

		/// <summary>
		/// Current username of the person the log is about, or SYSTEM
		/// </summary>
    public string UserName
    {
      get { return m_userName; }
      set { m_userName = value; }
    }

		/// <summary>
		/// Log message
		/// </summary>
    public string Message
    {
      get { return m_message; }
      set { m_message = value; }
    }

		/// <summary>
		/// Timestamp of the log
		/// </summary>
    public DateTime? Timestamp
    {
      get { return m_timestamp; }
      set { m_timestamp = value; }
    }

		/// <summary>
		/// Used for the Usage system, it's the current playing time for a user
		/// </summary>
    public int? Time
    {
      get { return m_time; }
      set { m_time = value; }
    }

		/// <summary>
		/// Used to modify the Time property, it's the time increment type
		/// of the time property, Hours/Mintues
		/// </summary>
    public TimeType? TimeType
    {
      get { return m_timeType; }
      set { m_timeType = value; }
    }

		/// <summary>
		/// Stored hash of the log entry
		/// </summary>
    public string Hash
    {
      get { return m_hash; }
      set { m_hash = value; }
    }

    #endregion Public Properties

    #region Public Functions
		/// <summary>
		/// Computes the current hash for critical object members
		/// </summary>
		/// <returns>Hash as a string</returns>
    public string ComputeHash()
    {
      StringBuilder newHash = new StringBuilder();

			if (m_userName != null)
				newHash.Append(m_userName);

			if (m_time != null)
				newHash.Append(m_time.ToString());

			if (m_parentId != null)
				newHash.Append(m_parentId.ToString());

			if (m_timeType != null)
				newHash.Append(m_timeType.ToString());

			if (m_message != null)
      newHash.Append(m_message);

      return Common.Hash.ComputeHash(newHash.ToString(), "SHA256", null);
    }

		/// <summary>
		/// Checks to ensure the computed hash matches the current
		/// hash of critical object members.
		/// </summary>
		/// <returns>True if the hashs match, otherwise false.</returns>
    public bool IsHashValid()
    {
      if (m_hash == null)
        return false;

			return Common.Hash.VerifyHash(ComputeHash(), "SHA256", m_hash);
    }
    #endregion Public Functions
  }
    */
}